package com.cdd.agent.api.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cdd.common.domain.entity.AgentUser;
import com.cdd.agent.api.mapper.AgentUserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author cdd
 * @date 2025-08-08 10:05
 */
@Service
public class AgentUserService {

    @Resource
    private AgentUserMapper agentUserMapper;

    public AgentUserMapper getBaseMapper() {
        return agentUserMapper;
    }

    public AgentUser findByUser(String loginname, String password) {
        return agentUserMapper.selectOne(
                new LambdaQueryWrapper<AgentUser>()
                        .eq(AgentUser::getUsername, loginname)
                        .eq(AgentUser::getPassword, password)
        );
    }
}
